<!--#include file="public/head.asp" -->
<script runat="server" language="jscript">
	function saveStaticPage(){
		var post     = $$.form.post();
		var nodeName = Request.QueryString('ns');
		
		var filePath = Server.Mappath($$.cfg.edk_root + '/app/form/staticPage.xml');
	    var xml = new ActiveXObject('Msxml2.DOMDocument.6.0');
	    if(!xml.load(filePath)){
	        throw "打开模板文件错误";
	    }

		var parentNode = xml.selectSingleNode('//' + nodeName);
		var CDataNode  = xml.createCDATASection(post['Content']);
		parentNode.replaceChild(CDataNode, parentNode.childNodes(0));
		
		$$.XML.saveXML(xml, filePath);
		
		return true;
	}
	if(saveStaticPage()){
		Response.Write('写入CData数据成功！');
	}
</script>